import {UtilService} from "../../providers/utilService";

declare var HomePageJS: any;

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, Slides } from 'ionic-angular';


// import {AuditPage} from '../audit/audit';
// import {BarcodePage} from '../barcode/barcode';
// import {MemberManangePage} from '../member-manange/member-manange';
// import {OrderManagePage} from '../order-manage/order-manage';

import {UrlService} from '../../providers/urlService';
import {IntfService} from '../../providers/intfService';
import {StorageService} from '../../providers/storageService';
import { ParamService } from '../../providers/paramService';
import {ViewChild } from '@angular/core';


/**
 * Generated class for the TabsHomePage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-tabs-home',
  templateUrl: 'tabs-home.html',
})
export class TabsHomePage {


  @ViewChild(Slides) slides: Slides;
  user: any; //登录用户信息
  userRight: any; //登录用户权限信息
  loginUser: any = {};// 登陆信息

  NavJsonData: any = '';//成员信息

  constructor(private navCtrl: NavController,
              private navParams: NavParams,
              private intfService: IntfService,
              private storageService: StorageService) {
  }

  ionViewDidLoad() {
    //开启页面拖拽 滑动
    // UtilService.onTouchMove(false);
    //HomePageJS.waveEffect();

    this.qtySysAcct();

    this.loginUser = ParamService.loginUser;//获取登陆信息
    this.NavJsonData = ParamService.NavJsonData;//获取菜单信息

  }

  ionViewWillEnter(){
    this.slides.startAutoplay();
  }
  ionViewWillLeave(){
    this.slides.stopAutoplay();
  }

  ionViewDidEnter(){
    this.slides.autoplayDisableOnInteraction = false;
  }

  //跳转到页面
  toPage(pageName: any) {
    alert("跳转页面："+pageName);
    this.navCtrl.push(pageName, {
    });
  }



  //查询部门子账户
  qtySysAcct() {
    /*
    let qtySysAcctParam = {};//ParamService.getQtySysAcctParam();
    this.intfService.getReq(UrlService.url_mainContent_qtySysAcct(), qtySysAcctParam, true).then((data) => {
      if(data.respCode=='0' ){
        this.SysBalance = !data.data.SysBalance?0:data.data.SysBalance/100;//保存代理商账本
      }else{
        console.log("查询部门子账户异常:"+data.respDesc);
      }

    }).catch((error) => {
      console.log("查询部门子账户其他异常");
      // downloading.dismiss();
    });
*/
  }

  //获取订单汇总信息
  queryOrderSumInfo() {
    /*
    let queryOrderSumInfoParam = {};//ParamService.getQueryOrderSumInfoParam();
    this.intfService.getReq(UrlService.url_mainContent_queryOrderSumInfo(), queryOrderSumInfoParam, true).then((data) => {
      if(data.respCode=='0' ){
        this.orderCount=data.data.TOTAL_ORDER;
        this.orderFee=!data.data.TOTAL_FEE ? 0 : data.data.TOTAL_FEE;
      }else{
        console.log("获取订单汇总信息异常:"+data.respDesc);
      }

    }).catch((error) => {
      console.log("获取订单汇总信息其他异常");
      // downloading.dismiss();
    });
*/
  }

}
